<link rel="stylesheet" href="templates/system/dictionaryManagement/css/dictionaryManagement.css" />
<div class="pd14 vany_authority">
    <div class="vany_treeTable pd14" id="authority">
        <!--面包屑-->
        <div class="pb10" id="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item>系统设置</el-breadcrumb-item>
                <el-breadcrumb-item>字典管理</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <!--表格-->
        <div id="treeTable" class="treeTable">
            <div id="treeLeft">
            	<div style="position:relative;">
            		<div class="elInput">
            			<el-input placeholder="输入关键字进行过滤" v-model="filterText" icon="search">
				        </el-input>
				    </div>
			        <h1 class="treetitle" v-once>
			        	<span v-html="icon"></span>
			        	<span>数据类型</span>
			        	<span @click="rightIconClick" v-html="rightIcon" style="position: absolute; right: 20px; cursor: pointer;"></span>
			        </h1>
			        <el-tree :default-expanded-keys="defaultExpandedKeys" class="filter-tree" :data="data" :node-key="defaultProps.id" :props="defaultProps" highlight-current :expand-on-click-node="false" @node-click="handleNodeClick" :filter-node-method="filterNode" ref="tree">
			        </el-tree>
			        <el-dropdown :hide-on-click="false" @command="handleCommand" style="display:none" ref="contexts" trigger="click" v-if="contexts" @visible-change="showContexts">
			        	<span class="el-dropdown-link">
			        		<i class="el-icon-caret-bottom"></i>
			        	</span>
			        	<el-dropdown-menu class="vanytree-contexts" slot="dropdown">
			        		<el-dropdown-item v-for="(context, index) in contexts" :key="context.name" :command="''+index" divided :disabled="context.disabled" :authority="context.authority">{{context.name}}</el-dropdown-item>
			        	</el-dropdown-menu>
			        </el-dropdown>
            		<div class="moveline"></div>
            	</div>
            </div>
            <div id="tableR" class="item i2">
            	<div id="table_dic">
	                <div class="pd14">
	                    <el-row :gutter="8">
	                        <el-col :span="16">
	                            <el-form :inline="true"  class="demo-form-inline">
	                                <el-form-item  style="margin-bottom: 0px" >
	                                    <el-input placeholder="请输入您要搜索的内容" @keyup.enter.native="search":on-icon-click="search" style="border-radius: 0px" v-model="keyword" icon="search" ></el-input>
	                                </el-form-item>
	                            </el-form>
	                        </el-col>
	                        <el-col :span="8">
	                            <el-row type="flex" justify="end">
	                                <el-button type="primary" @click="addDic">添加字典</el-button>
	                            </el-row>
	                        </el-col>
	                    </el-row>
	                </div>
	                <#list configer as itemOut>
		                <el-table :data="tableData" id="${itemOut.tableCode}Tb" class="<#if (itemOut.tableCode!"defaultValue") == "t_dictionary_country">activeTb<#else >displayTb</#if>" v-loading="loading":height="tableHeight" style="width:100%;" ref="multipleTable" @selection-change="handleSelectionChange">
		                    <#list itemOut.tableConfigers as itemIn>
			                    <el-table-column prop="${itemIn.columnName}" show-overflow-tooltip label="${itemIn.columnComment}"></el-table-column>
		                    </#list>
		                    <el-table-column label="操作" width="100">
		                        <template scope="scope">
		                            <el-button type="text" size="small" @click="editDic(scope.row)">编辑</el-button><span style="color:#333;margin:0 0 0 5px">|</span>
		                            <el-button type="text" size="small" @click="deleteDic(scope.row)">删除</el-button>
		                        </template>
		                    </el-table-column>
		                </el-table>
	                </#list>
	            </div>
	            <div class="pd14" style="border-top: 0;background: #eaedf2;">
	                <el-row>
	           
	                    <el-col :span="24">
	                        <el-row type="flex" justify="end">
	                            <el-pagination
	                                    @size-change="handleSizeChange"
	                                    @current-change="handleCurrentChange"
	                                    :current-page="pageIndex"
	                                    :page-sizes="[10, 20, 30]"
	                                    :page-size="pageSize"
	                                    layout="total, sizes, prev, pager, next, jumper"
	                                    :total="total">
	                            </el-pagination>
	                        </el-row>
	                    </el-col>
	                </el-row>
	            </div>
            </div>
        </div>
        
        <div id="dialogInfos">
			<el-dialog title="字典管理" :visible.sync="dialogVisible" id="dialog_dic" :before-close="handleClose">
				<#list configer as itemOut>
					<el-form :model="${itemOut.tableCode}Form" :rules="rules" ref="${itemOut.tableCode}Form" id="${itemOut.tableCode}Form" label-width="140px" class="demo-ruleForm <#if (itemOut.tableCode!"defaultValue") == "t_dictionary_country">activeTb<#else >displayTb</#if>">
						<#list itemOut.tableConfigers as itemIn>
							<el-form-item label="${itemIn.columnComment}:" prop="${itemIn.tableName}_${itemIn.columnName}" >
								<el-input :maxlength="10" <#if (itemIn.columnKey!"defaultValue") == "PRI">v-bind:disabled="disabledInput"<#else ></#if> v-model="${itemIn.tableName}Form.${itemIn.tableName}_${itemIn.columnName}"  id="${itemIn.tableName}_${itemIn.columnName}" ></el-input>
							</el-form-item>
						</#list>
						<el-form-item>
							<el-button type="primary" @click="submitForm('t_dictionary_countryForm')">确定</el-button>
							<el-button type="primary" @click="cancelForm('t_dictionary_countryForm')">取消</el-button>
						</el-form-item>
					</el-form>
				</#list>
			</el-dialog>
		</div>
    </div>
</div>
<script type="text/javascript" src="templates/system/dictionaryManagement/js/dictionaryManagement.js?ts=new Date().getTime()"></script>
<script type="text/javascript" src="templates/authority/common/js/moveline.js"></script>